#include <iostream>
#include "krpc/udp.h"
#include "krpc/tcp.h"
#include "krpc/subcribe.h"
#include "krpc/localstream.h"
#include "krpc/localdgram.h"

struct hehe
{
	int a;
	int b;
	MSGPACK_DEFINE(a,b);

};

int main(int argc, char const *argv[])
{
#if 1
	//KRPC::UDP com("127.0.0.1", 9000);
	//KRPC::TCP com("127.0.0.1", 9000);
	KRPC::LOCALDGRAM com("unix");
	//KRPC::LOCALSTREAM com("unix");
	KRPC::Subcribe<std::string, int> sub("sub", com, 3000);
	sub.run([](std::string str, int i){
		std::cout << "str: " << str << ", i: " << i << std::endl;
	});
#endif

#if 0
	KRPC::TCP com("127.0.0.1", 9000);
	KRPC::Subcribe<struct hehe> sub("hehe", com, 3000);
	sub.run([](struct hehe hi){
		std::cout << "a: " << hi.a << ", b: " << hi.b << std::endl;
		});
#endif
	return 0;
}
